﻿<%@ Page Language="c#" ContentType="text/html" ResponseEncoding="utf-8" Async="true" MasterPageFile="~/administration/list_private.master" Inherits="ACM.cmsarea08.Administration.Core.EditRuolo" %>
<%@ MasterType VirtualPath="~/administration/list_private.master" %>
<asp:Content ID="PageBody" Runat="server" ContentPlaceHolderID="MasterBody">
<style>
	div.sec{
		width: 400px; 
		float:left;
	}
	
	


</style>
<h1><img src="../template/admimg/userrole_big.jpg" alt="User Roles Manager" />Gestione Ruoli Utente</h1>
<div style="clear:both;">

<div style="float:right; width:45%;"><asp:Label id="warnme" runat="server"></asp:Label></div>
</div>
<div style="clear:both;">
<asp:TextBox ID="rolename" runat="server"></asp:TextBox>

<select onchange="fai(this)" id="dropRuoli" runat="server" >

</select>
   
   <br />

 <input type="checkbox" ID="check0" onchange="CambiaValore(this)" title="Publisher">Publisher</input><br />
<div class="sec">
	<h3>Sezioni</h3>
    <input type="checkbox" ID="check1"onchange="CambiaValore(this)" title="<%= rm.GetString("insert") %>"><%= rm.GetString("insert") %></input><br />
    <input type="checkbox" ID="check2"onchange="CambiaValore(this)" title="<%= rm.GetString("edit") %>"><%= rm.GetString("edit") %></input><br />
    <input type="checkbox" ID="check3"onchange="CambiaValore(this)" title="<%= rm.GetString("delete") %>"><%= rm.GetString("delete") %></input><br />
    <input type="checkbox" ID="check4"  title="<%= rm.GetString("trans") %>"><%= rm.GetString("trans") %></input>
</div>
<div class="sec">
	<h3>Categorie</h3>
    <input type="checkbox" ID="check5"onchange="CambiaValore(this)" title="<%= rm.GetString("insert") %>" ><%= rm.GetString("insert") %></input><br />
    <input type="checkbox" ID="check6"onchange="CambiaValore(this)" title="<%= rm.GetString("edit") %>"><%= rm.GetString("edit") %></input><br />
    <input type="checkbox" ID="check7"onchange="CambiaValore(this)" title="<%= rm.GetString("delete") %>"><%= rm.GetString("delete") %></input><br />
    <input type="checkbox" ID="check8"onchange="CambiaValore(this)" title="<%= rm.GetString("trans") %>"><%= rm.GetString("trans") %></input>
</div>
<div class="sec"> 
	<h3>Articoli</h3>   
    <input type="checkbox" ID="check9"onchange="CambiaValore(this)" title="<%= rm.GetString("insert") %>"><%= rm.GetString("insert") %></input><br />
    <input type="checkbox" ID="check10"onchange="CambiaValore(this)" title="<%= rm.GetString("edit") %>"><%= rm.GetString("edit") %></input><br />
    <input type="checkbox" ID="check11"onchange="CambiaValore(this)" title="<%= rm.GetString("delete") %>"><%= rm.GetString("delete") %></input><br />
    <input type="checkbox" ID="check12"onchange="CambiaValore(this)" title="<%= rm.GetString("trans") %>"><%= rm.GetString("trans") %></input>
</div>
<div class="sec"> 
	<h3>Template</h3>   
    <input type="checkbox" ID="check13"onchange="CambiaValore(this)" title="<%= rm.GetString("insert") %>"><%= rm.GetString("insert") %></input><br />
    <input type="checkbox" ID="check14"onchange="CambiaValore(this)" title="<%= rm.GetString("edit") %>"><%= rm.GetString("edit") %></input><br />
    <input type="checkbox" ID="check15"onchange="CambiaValore(this)" title="<%= rm.GetString("delete") %>"><%= rm.GetString("delete") %></input>
</div>
<div class="sec"> 
	<h3>Moduli</h3>   
    <input type="checkbox" ID="check26"onchange="CambiaValore(this)" title="<%= rm.GetString("insert") %>"><%= rm.GetString("insert") %></input><br />
    <input type="checkbox" ID="check27"onchange="CambiaValore(this)" title="<%= rm.GetString("edit") %>"><%= rm.GetString("edit") %></input><br />
    <input type="checkbox" ID="check28"onchange="CambiaValore(this)" title="<%= rm.GetString("delete") %>"><%= rm.GetString("delete") %></input>
</div>
<div class="sec"> 
	<h3>Altre Gestioni</h3>   
    <input type="checkbox" ID="check16" onchange="CambiaValore(this)" onchange="CambiaValore(this)" title="Statistiche">Statistiche</input><br />
    <input type="checkbox" ID="check17"onchange="CambiaValore(this)" title="Utenti">Utenti</input><br />
    <input type="checkbox" ID="check18"onchange="CambiaValore(this)" title="Ruoli">Ruoli</input><br />
    <input type="checkbox" ID="check19"onchange="CambiaValore(this)" title="Modelli Utenti">Modelli Utenti</input><br />
    <input type="checkbox" ID="check20"onchange="CambiaValore(this)" title="Menu Utenti">Menu Utenti</input><br />
    <input type="checkbox" ID="check21"onchange="CambiaValore(this)" title="HomePage">HomePage</input><br />
    <input type="checkbox" ID="check22"onchange="CambiaValore(this)" title="Blocchi Visivi">Blocchi Visivi</input><br />
    <input type="checkbox" ID="check23"onchange="CambiaValore(this)" title="Menu">Menu</input><br />
    <input type="checkbox" ID="check24"onchange="CambiaValore(this)" title="Voci di Menu">Voci di Menu</input><br />
    <input type="checkbox" ID="check25"onchange="CambiaValore(this)" title="Plugins">Plugins</input>
</div>

<asp:LinkButton ID="leggi" runat="server" Text="Leggi" ></asp:LinkButton>
<input type="hidden" id="_idm" runat="server" />
<input type="hidden" id="_sec" runat="server" />
</div>
<script type="text/javascript">
var temp = document.getElementById('<%= _sec.ClientID %>');

function fai(ob){
	setta(ob.options[ob.selectedIndex].value);
}
function setta(security){
	temp.value=security;
	for(i=0;i<29;i++){
		var check = document.getElementById('check'+i.toString());
		if(check!=null){
			if(security[i]=='0'){
				check.checked=false;
				check.disabled=true;
			}
			else{
				check.disabled=false;
				check.checked=true;
			}
		}
		
	}
}

function CambiaValore(check){
	var n = check.id.replace('check','');
	var valore = temp.value;
	alert('prima: id=' + n + ' \nchecked = ' + check.checked + ' \nvalore=' + valore + ' \nchecked = ' + check.checked);
	if(check.checked==true) {
		alert('durante(true)');
		valore[n] = '1';
	}
	else{
		alert('durante(false)');
		valore[n] = '0';
	}
	alert('dopo: ' + valore);
	temp.value = valore;
	
}


</script>
</asp:content>